package com.hp.controller;

import com.hp.service.CustomerCouponService;
import com.hp.util.JsonData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 客户和优惠券关联Controller
 */
@Controller
@RequestMapping("/CustomerCoupon")
public class CustomerCouponController {
    @Resource
    private CustomerCouponService service;
    @RequestMapping("/issue")
    @ResponseBody
    public Object add(Integer id,String customerIds){
        int i=service.add(id,customerIds);
        return JsonData.buildSuccess(i>0?"优惠券发送成功！":"优惠券发送失败！");
    }
}
